home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 747 b | 52 lines | [TEXT/CWIE] |
- // MenuResult.h
-
- #ifndef MenuResult_h
- #define MenuResult_h
-
- #ifndef Integers_h
- #include "Integers.h"
- #endif
- #ifndef MenuID_h
- #include "MenuID.h"
- #endif
- #ifndef Assert_h
- #include "Assert.h"
- #endif
-
- class MenuResult
- {
- private:
- MenuID menu;
- uint16 item;
-
- public:
- MenuResult( int32 combined )
- : menu( Word1( combined ) ),
- item( Word0( combined ) - 1 )
- {
- Assert( combined == 0 || Word0( combined ) > 0 );
- }
-
- MenuResult( MenuID theMenu, uint16 theItem )
- : menu( theMenu ),
- item( theItem )
- {
- }
-
- bool Null() const { return menu == 0; }
-
- MenuID Menu() const
- {
- Assert( !Null() );
- return menu;
- }
-
- uint16 Item() const
- {
- Assert( !Null() );
- return item;
- }
- };
-
- #endif
-